classlar arasında view transferi
merhaba arkadaşlar.. Ben bir activity içerisinde o activity için tanımlı layouttaki nesneleri
tüm procedurlerde ve içerisine tanımlı classlarda kullanılabilmek istiyorum bunun için şöyle bir tanımlama yaptım ama sistem daha application açılırken çakılıyor
package com.example.derunservis;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBar;
import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.os.Build;
import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.PropertyInfo;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;
public class MainActivity extends ActionBarActivity {
private String[] Liste;
private static final String NAMESPACE = "http://tempuri.org/";
private static final String URL = "http://duru/DeroidServer/DeroidService.asmx";
private static final String METHOD_NAME = "GetMusteri";
private static final String SOAP_ACTION = "http://duru/DeroidServer/DeroidService.asmx/GetNusteri"; // örnek: http://deneme/webservice.asmx/kullanılacak_method - See more at: http://blog.melihmucuk.com/android-programlama-dotnet-web-service-kullanimi/#sthash.yYEbAGCo.dpuf
private EditText edtCariID=new EditText(this);
private EditText edtCariKod=new EditText(this);
private EditText edtUnvan=new EditText(this);
private Button btnBul=new Button(this);
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.container, new PlaceholderFragment())
.commit();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
/**
* A placeholder fragment containing a simple view.
*/
public static class PlaceholderFragment extends Fragment {
public PlaceholderFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_main, container, false);
return rootView;
}
}
}